package 举例子;

public class StudentCostDemo {
   public static void main(String[] args) {
	   Student s1=new Student();
	   s1.name="张三";
	   s1.isFee=false;
	   
	   Student s2=new Student();
	   s2.name="李四";
	   s2.isFee=true;
	   
	   Student s3=new Student();
	   s3.name="大宋";
	   s3.isFee=true;
	   
	   Student s4=new Student();
	   s4.name="李建";
	   s4.isFee=false;
	   

	   Student[] arr = new Student[]{s1,s2,s3,s4};//创建字符串数组来存储字符串
	   
	   System.out.println(s1==arr[0]);//arr[]这样的存储类型
	   
	   for(Student ele:arr){
//		   System.out.println(ele);
//		   System.out.println(ele.name+":"+ele.isFee);
		   
		   if(ele.isFee){//ele.isFee遍历数组里面的true
			   System.out.println(ele.name+":"+"已缴费");
		   }
		   
		   if(!ele.isFee){
			   System.out.println(ele.name+":"+"还没有交费");
		   }
		   
	   }
	   
   }
}

class Student{
	 String name;
	 boolean isFee=false;
	 
	 void fees(){//已经交费的情况
		 isFee=true;
	 }

}
